Save a Test in ALM
Source code
'************************************************************************************************************************
'Description:
'This example connects to an ALM project, creates a new test
'and saves it in ALM.
'
'Assumptions:

'There is no unsaved test currently open in UFT One. For more information,
'see the Test.SaveAs example for saving a test locally.
'When UFT One opens, it loads the add-ins required for the test. For more information,
'see the example for the Test.GetAssociatedAddins method.
'
'************************************************************************************************************************

Dim qtApp 'As QuickTest.Application ' Declare the Application object variable

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start UFT One
qtApp.Visible = True ' Make the UFT One application visible

qtApp.TDConnection.Connect "http://qcserver/qcbin", _
              "MY_DOMAIN", "My_Project", "James", "not4you", False ' Connect to ALM

If qtApp.TDConnection.IsConnected Then ' If connection is successful

  qtApp.New ' Create a new test
  qtApp.Test.SaveAs "[QualityCenter] Subject\MtTest" 'Save it to ALM

End If

qtApp.Quit ' Exit UFT One
Set qtApp = Nothing